<script type="text/javascript">
//jQuery(document).ready(function(jQuery) {

/*
	jQuery('#new_list_container').hide();

    jQuery('#new_list_trigger').click(function() { 

		jQuery('#new_list_container').slideDown();
		
		jQuery('#add_new_checkbox').attr('checked', true);
		
		jQuery('#add_new_inputbox').focus();
		
		return false;

   });   

	<? // if( !is_array($wishlists) || (empty($wishlists))) { ?>
		jQuery('#new_list_trigger').click();
		jQuery('#add_new_inputbox').val('<? // =DEFAULT_WISHLIST_TITLE?>');
	<? // } ?>
*/

	
	jQuery('#select_list_form').submit(function(e) {
  		
		e.preventDefault();
		e.stopPropagation();
		
		var form = jQuery('#select_list_form');
		var overlay = jQuery("#overlay");
		var container = jQuery("#overlay .overlay_container");
		var url = form.attr('action');
		var data = form.serializeArray();
		
		// don't submit if no list is selected
		if(jQuery('#select_list_form input:checked').length == 0) {
			return false;	
		}

		// send data from the form and load response
		container.html('');
		overlay.addClass("loading");
		container.load(url, data, function(){
			overlay.removeClass("loading");
		}); 		
	});
	


//});
</script>


<h1>Add product to wish list</h1>

<div class="preview">
    <div class="contain">
        <img height="66" border="0" width="106" alt="" src="<?=base_url().UPLOADS_FOLDER.PRODUCT_IMG_FOLDER.thumbnail($item["Main_Image"])?>"/>
        <p>
          <strong>
				<?=$item["Name_Products"]?>
          </strong>
        </p>
        
        <p>
          <?=$item["Introduction_Products"]?>
        </p>

	</div>
</div>


<form id="select_list_form" action="<?=site_url('wishlist/add_product_to_multiple_lists')?>" method="post">

	<p>Select a list to move this product to</p>            
        
    <? foreach( $wishlists as $list) { ?>
    
        <label>
        <input class="js_required" type="checkbox" name="lists[]" value="<?=$list["params"]?>" /> <?=$list["name"]?> (<?=count($list["items"])?> product<? if (count($list["items"])!=1) { ?>s<? }?>)
        </label>
    
    <? } ?>

	<br /><br /><br /><br />


	<!-- FIX ME: Move this class to the stylesheet, there should be no inline styling here -->
	<div class="bottom_buttons" style="position:absolute;bottom:30px">
    
        <input type="hidden" name="product_id" value="<?=$item["id_Products"]?>" />
        <input type="hidden" name="token" value="<?=$token?>" />
        <input class="button" type="submit" name="submit" value="ADD TO WISH LIST" />
        <a class="button cancel" href="#">CANCEL</a>

	</div> 

</form>
